package fr.labri.harmony.analysis.jsep.results;

import java.io.IOException;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import fr.labri.harmony.analysis.jsep.results.filter.CorpusMigrantsStatsSummary;
import fr.labri.harmony.analysis.jsep.results.filter.CorpusStatsSummary;
import fr.labri.harmony.analysis.jsep.results.filter.CorpusStatsSummaryBigSmall;
import fr.labri.harmony.analysis.jsep.results.filter.MigrationCategories;
import fr.labri.harmony.analysis.jsep.results.filter.MigrationClassifier;
import fr.labri.harmony.analysis.jsep.results.filter.MigrationComments;
import fr.labri.harmony.analysis.jsep.results.filter.MigrationDatesCategory;
import fr.labri.harmony.analysis.jsep.results.filter.MigrationEvolutionRatio;
import fr.labri.harmony.analysis.jsep.results.filter.MigrationFiles;
import fr.labri.harmony.analysis.jsep.results.filter.MigrationHours;
import fr.labri.harmony.analysis.jsep.results.filter.MigrationLength;
import fr.labri.harmony.analysis.jsep.results.filter.MigrationLoopbackBounce;
import fr.labri.harmony.analysis.jsep.results.filter.MigrationNbDevs;
import fr.labri.harmony.analysis.jsep.results.filter.MigrationRulesSummary;
import fr.labri.harmony.analysis.jsep.results.filter.MigrationTestPrecision;
import fr.labri.harmony.analysis.jsep.results.filter.MigrationUsageLibrary;
import fr.labri.harmony.analysis.jsep.results.filter.ResultFilter;

public class MainResults {

	public static void main(String[] args) throws IOException, SQLException, ClassNotFoundException {

		Class.forName("com.mysql.jdbc.Driver");

		//Compute general data
		ResultSet rs = DBConnection.fetchData();
		List<ResultFilter> filters = new ArrayList<>();
		//		filters.add(new MigrationClassifier());//
		//		filters.add(new MigrationComments());
		//		filters.add(new MigrationDatesCategory(Categories.test, "test"));
		//		filters.add(new MigrationDatesCategory(Categories.datastorage, "datastorage"));
		//		filters.add(new MigrationDatesCategory(Categories.html, "html"));
		//		filters.add(new MigrationDatesCategory(Categories.json, "json"));
		//		filters.add(new MigrationDatesCategory(Categories.testutil, "testutil"));
		//		filters.add(new MigrationEvolutionRatio());
		//		filters.add(new MigrationFiles());
		//		filters.add(new MigrationHours());
		//		filters.add(new MigrationLength());
		//		filters.add(new MigrationNbDevs());
		//		filters.add(new CorpusStatsSummary());
		filters.add(new CorpusStatsSummaryBigSmall());
		//		filters.add(new CorpusMigrantsStatsSummary());
		//		filters.add(new MigrationRulesSummary());
		//		filters.add(new MigrationTestPrecision());
		//		filters.add(new MigrationCategories());
		//filters.add(new MigrationDatesCategory());
		//filters.add(new MigrationUsageLibrary());
		//filters.add(new MigrationLoopbackBounce());
		for(ResultFilter filter : filters)
			filter.computeResult(rs);

		rs.close();
	}

}
